$(function () {
    var token = sessionStorage.getItem("token");
    var method = "Order|order_detail";
    var order_id = sessionStorage.getItem("order_id");
    var d = {};
    d.order_id = order_id;
    d.token = token;
    d.method = method;
    $.ajax({
        type: "post",
        url: "http://www.rice.com/app/api/h5_access",
        data: d,
        dataType: "json",
        success: function (result) {
            console.log(result);
            if (result.status == "1") {
                var data = result.data;
                var sttr = "";
                if (!data) {
                    alert("没有数据");
                }
                sttr += '<div style="text-align: center;padding: 50px 50px 30px 50px;"><img src="img/Withdrawal_lose.png" width="60" alt="" /><span style="display: block;padding: 10px 0 5px 0;font-size: 30px;color: #FA7F70;">' + data.amount + '</span><span style="display: block;padding: 5px;font-size: 13px;color: #777777;">' + data.status_name + '</span></div>';
                sttr += '<div class="am-u-sm-12" style="border-top: 1px solid #A6A6A6;border-bottom: 1px solid #a6a6a6;padding: 10px 0 10px 0;font-size: 13px;"><div class="am-u-sm-6" style="color: #a6a6a6;">交易类型</div><div class="am-u-sm-6" style="text-align: right;">' + data.type_name + '</div></div>';
                sttr += '<div class="am-u-sm-12" style="border-bottom: 1px solid #a6a6a6;padding: 10px 0 10px 0;font-size: 13px;"><div class="am-u-sm-6" style="color: #a6a6a6;">交易时间</div><div class="am-u-sm-6" style="text-align: right;">' + data.add_time + '</div></div>';
                sttr += '<div class="am-u-sm-12" style="border-bottom: 1px solid #a6a6a6;padding: 10px 0 10px 0;font-size: 13px;"><div class="am-u-sm-6" style="color: #a6a6a6;">手续费</div><div class="am-u-sm-6" style="text-align: right;">' + data.fee + '</div></div>';
                sttr += '<div class="am-u-sm-12" style="border-bottom: 1px solid #a6a6a6;padding: 10px 0 10px 0;font-size: 13px;"><div class="am-u-sm-6" style="color: #a6a6a6;">卡号</div><div class="am-u-sm-6" style="text-align: right;">' + data.bank_no + '</div></div>';
                sttr += '<div class="am-u-sm-12" style="padding: 10px 0 10px 0;font-size: 13px;"><div class="am-u-sm-6" style="color: #a6a6a6;">交易结果</div><div class="am-u-sm-6" style="text-align: right;">' + data.status_name + '</div></div>';

                $("#txxq").html(sttr);
            } else if (result.status == "2") {
                alert(result.message);
                location.href = "login.html";
            } else {
                alert(result.message);
            }
        }
    })
})